<?php 

class BackendAreaImageForm extends AreaImageForm
{
  public function configure()
  {
    unset(
      $this['created_at'], 
      $this['updated_at']
    );
    
    $this->widgetSchema['image'] = new sfWidgetFormInputFileEditable(array(
      'is_image' => true,
      'edit_mode' => !$this->isNew(),
      'file_src' => sprintf(sfConfig::get('app_path_area_image'), $this->getObject()->getImage()),
      'with_delete' => false
    ));
    
    $this->validatorSchema['image'] = new sfValidatorFile(array(
      'max_size' => 1 * 1024 * 1024,
      'path' => Wills::getUploadDirByWebPath(sfConfig::get('app_path_area_image')),
      'mime_types' => 'web_images',
      'required' => false
    ));
    
    $this->widgetSchema['area_id']->addOption('table_method', 'getAdminAreaListQuery');
    
    $this->validatorSchema['description'] = new sfValidatorPass();
  }
}